package edu.hawaii.senin.iclouds.simple;

import java.util.ArrayList;
import java.util.Iterator;

import edu.hawaii.senin.iclouds.basics.Specie;

/**
 * Encapsulates cloud population and provides iterator over it.
 * 
 * @author Pavel Senin.
 * 
 */
public class CloudPopulation implements Iterable<Specie> {

  /**
   * Storage.
   */
  private ArrayList<Specie> storage = new ArrayList<Specie>();

  /**
   * Instantiates the population.
   * 
   */
  public CloudPopulation() {
    assert true;
    // does nothing
  }

  /**
   * Adds specie into population.
   * 
   * @param sp new specie to add.
   */
  public void add(Specie sp) {
    this.storage.add(sp);
  }

  /**
   * Provides the Iterator over the population.
   * 
   * @return Iterator over the collection.
   */
  public Iterator<Specie> iterator() {
    return this.storage.iterator();
  }

}
